home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / comm / misc / LogSTFax.lha / LogSTFax.rexx < prev   
OS/2 REXX Batch file  |  1999-01-06  |  2KB  |  57 lines

  1. /*
  2. $VER: LogSTFaxCalls.rexx 1.0 (14.9.98)
  3. by Neil Bothwick
  4. This logs all incoming calls to STFax, including
  5. CallerID information where available
  6. */
  7.  
  8. /* Change this to the name of your logfile */
  9. logfile = 'STFax:STFaxCalls'
  10.  
  11.  
  12. options results
  13. port = address()
  14. address command
  15.  
  16. if getclip('STFaxRingTime') = '' then call setclip('STFaxRingTime',0)
  17. if time(s) - getclip('STFaxRingTime') > 5 then call setclip('STFaxRingCount',0)
  18. call setclip('STFaxRingCount',getclip('STFaxRingCount') + 1)
  19. call setclip('STFaxRingTime',time(s))
  20.  
  21. select
  22.     /* open GUI on first ring and optionally send commands to other programs */
  23.     when getclip('STFaxRingCount') = 1 then do
  24.         address(port)
  25.         'SHOW'
  26.         address command
  27.         /* Add any commands you would like executed when the phone rings*/
  28.         /* These are the ones I use to shut off all music programs */
  29.         /*
  30.         if show('P','YACDP') = 1 then address 'YACDP' 'STOP'
  31.         if show('P','ACDPLAY') = 1 then address 'ACDPLAY' 'STOP'
  32.         if show('P','AMIGAAMP') = 1 then do
  33.             address 'AMIGAAMP'
  34.             'STATUS'
  35.             if result = 'PLAY' then 'PAUSE'
  36.             end
  37.         'Tools:Sound/tinymidiplay'
  38.         'breakname MPEGA'
  39.         */
  40.         end
  41.  
  42.     /* Wait for second ring for Caller ID information to become available */
  43.     when getclip('STFaxRingCount') = 2 then do
  44.         address(port)
  45.         'GETCALLERID'
  46.         CallerNo = result
  47.         'GETCALLERNAME' CallerNo
  48.         CallerName = result
  49.         address command
  50.         'echo >>"'logfile'"' left(date('W'),3) date('N')',' time() left(CallerNo,20) CallerName
  51.         end
  52.     otherwise nop
  53.     end
  54.  
  55. exit
  56.  
  57.